/*------------------------------------------------------------------------------
*** PURPOSE: 	The following do-file generates Table 1 in the paper "Respondent 
				biases in household surveys" by Andrew Dillon and Edouard Romeo 
				Mensah. 

*** NOTE:		Relevant globals are defined in the do-file titles "master.do"
				contained in the folder "02_do" in the replication package.
------------------------------------------------------------------------------*/
	
	
	* Table 1. Treatment effects on land characteristics.
	
	* Without unbalanced covariates and without gender interaction with treatment.
	* S.E. clustered at village-level: All villages included.
	
			eststo clear
			foreach i in $depvars1 {
				reg `i' i.treat1_hhead i.treat2_rproxy, vce(cluster village)
				qui sum `i' if e(sample) & treatarm==0
				local ctrlmean=r(mean)
				local ctrlsd=r(sd)
				testparm i.treat1_hhead i.treat2_rproxy
				local pvalue_all=r(p)
				lincom 1.treat1_hhead - 1.treat2_rproxy
				local Treat1_2_coef=r(estimate)
				local Treat1_2_t=r(estimate)/r(se)
				local Treat1_2_p= tprob(r(df),abs(`Treat1_2_t'))
				eststo `i'_A, addscalars(pvalue_all `pvalue_all' Controlmean `ctrlmean' Controlsd `ctrlsd' ///
				Treat1_2_coef `Treat1_2_coef' Treat1_2_t `Treat1_2_t' pvalue_b1_b2 `Treat1_2_p')
			}
			
				
				
			esttab *_A using "04_output\Table 1. Treatment effects on land characteristics.csv", se ///
			scalars("pvalue_b1_b2 p-value: test of T1=T2" "pvalue_all p-value: joint test of T1 and T2" N "Controlmean Control Mean" "Controlsd Control S.D.") sfmt(3 3 0 3 3) ///
			title("Table 1: Treatment effects on land characteristics") ///
			mtitles("Native forest (ha)" "Pasture (ha)" "Field crops (ha)" "Garden crops (ha)" "Total land holdings (ha)" "Total area cultivated (ha)" "Main mode of aquiring cultivated plots: inheritance" "Main mode of aquiring cultivated plots: gift/donation" "Main type of soil on cultivated plots: clayey" "Main type of soil on cultivated plots: sandy") ///
			nonotes addnotes("All standard errors are clustered at the village level. *** p<0.01; ** p<0.05; * p<0.1." "Estimated without covariates and without gender interaction with treatment.") star(* 0.1 ** 0.05 *** 0.01)  ///
			coeflabels(1.treat1_hhead "T1: HH Head" 1.treat2_rproxy "T2: Random Proxy") drop(0.treat1_hhead 0.treat2_rproxy _cons) ///
			b(3) se(3) noobs width(25) replace
			
			estimates clear	
			
		
	